home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / tex-k / tex-k-archive.past / 1995.02 / 000055_vieth@thphy.uni-duesseldorf.de_Fri Feb 10 17:49:29 1995.msg < prev    next >
Internet Message Format  |  1995-02-28  |  4KB

  1. Received: from thphy.uni-duesseldorf.de (xerxes.thphy.uni-duesseldorf.de) by cs.umb.edu with SMTP id AA13425
  2.   (5.65c/IDA-1.4.4 for <tex-k@cs.umb.edu>); Fri, 10 Feb 1995 15:35:57 -0500
  3. Received: from macbeth.thphy.uni-duesseldorf.de.thphy.uni-duesseldorf.de by thphy.uni-duesseldorf.de (4.1/SMI-4.1)
  4.     id AA08650; Fri, 10 Feb 95 16:49:29 +0100
  5. Date: Fri, 10 Feb 95 16:49:29 +0100
  6. From: vieth@xerxes.thphy.uni-duesseldorf.de
  7. Message-Id: <9502101549.AA08650@thphy.uni-duesseldorf.de>
  8. Received: by macbeth.thphy.uni-duesseldorf.de.thphy.uni-duesseldorf.de (4.1/SMI-4.1)
  9.     id AA07990; Fri, 10 Feb 95 16:48:31 +0100
  10. To: tex-k@cs.umb.edu
  11. Subject: Missing patch for MetaPost
  12.  
  13. Hi folks,
  14.  
  15. it was pointed out to me in private mail that I forgot something when 
  16. I posted my patches to adapt MetaPost for web2c-6.1 last week.
  17.  
  18. Below is the missing patch for web2c/lib/openinout.c. It includes the 
  19. code for callmakempx (taken from mpext.c). Hope that was all I forgot. 
  20.  
  21. Have fun with MetaPost,
  22.  
  23. Ulrik Vieth.
  24.  
  25.  
  26.  
  27. *** web2c/lib/openinout.c.save    Wed Jan 11 10:56:38 1995
  28. --- web2c/lib/openinout.c    Wed Feb  1 12:13:16 1995
  29. ***************
  30. *** 23,31 ****
  31.   
  32.   #ifdef TeX
  33.   #include "texd.h"
  34. ! #else /* Metafont */
  35.   #include "mfd.h"
  36.   #endif
  37.   
  38.   #ifdef FUNNY_CORE_DUMP
  39.   /* This is defined in texmf.c.  */
  40. --- 23,35 ----
  41.   
  42.   #ifdef TeX
  43.   #include "texd.h"
  44. ! #endif
  45. ! #ifdef MF
  46.   #include "mfd.h"
  47.   #endif
  48. + #ifdef MP
  49. + #include "mpd.h"
  50. + #endif
  51.   
  52.   #ifdef FUNNY_CORE_DUMP
  53.   /* This is defined in texmf.c.  */
  54. ***************
  55. *** 57,63 ****
  56.       funny_core_dump ();
  57.   #endif /* FUNNY_CORE_DUMP and not BibTeX */
  58.   
  59. ! #ifdef BibTeX
  60.     if (path_index == NO_FILE_PATH)
  61.       {
  62.         unsigned temp_length;
  63. --- 61,67 ----
  64.       funny_core_dump ();
  65.   #endif /* FUNNY_CORE_DUMP and not BibTeX */
  66.   
  67. ! #if defined(BibTeX) || defined(MP)
  68.     if (path_index == NO_FILE_PATH)
  69.       {
  70.         unsigned temp_length;
  71. ***************
  72. *** 74,80 ****
  73.       }
  74.   
  75.     else
  76. ! #endif /* BibTeX */
  77.     
  78.     if (testreadaccess (nameoffile, path_index))
  79.       {
  80. --- 78,84 ----
  81.       }
  82.   
  83.     else
  84. ! #endif /* BibTeX || MP */
  85.     
  86.     if (testreadaccess (nameoffile, path_index))
  87.       {
  88. ***************
  89. *** 99,105 ****
  90.         else
  91.           namelength = strchr (nameoffile + 1, ' ') - nameoffile - 1;
  92.         
  93. ! #ifdef TeX
  94.         /* If we just opened a TFM file, we have to read the first byte,
  95.            since TeX wants to look at it.  What a kludge.  */
  96.         if (path_index == TFMFILEPATH)
  97. --- 103,109 ----
  98.         else
  99.           namelength = strchr (nameoffile + 1, ' ') - nameoffile - 1;
  100.         
  101. ! #if defined(TeX) || defined(MP)
  102.         /* If we just opened a TFM file, we have to read the first byte,
  103.            since TeX wants to look at it.  What a kludge.  */
  104.         if (path_index == TFMFILEPATH)
  105. ***************
  106. *** 107,113 ****
  107.             extern integer tfmtemp;
  108.             tfmtemp = getc (*f);
  109.           }
  110. ! #endif /* TeX */  
  111.   
  112.         openable = true;
  113.       }
  114. --- 111,117 ----
  115.             extern integer tfmtemp;
  116.             tfmtemp = getc (*f);
  117.           }
  118. ! #endif /* TeX || MP */
  119.   
  120.         openable = true;
  121.       }
  122. ***************
  123. *** 243,245 ****
  124. --- 247,289 ----
  125.     
  126.     return ret;
  127.   }
  128. + /**********************************************************
  129. +  The following is needed by MetaPost but not METAFONT
  130. +  **********************************************************/
  131. + #define CMDLENGTH 300
  132. + /*
  133. +  * Invoke makempx to make sure there is an up-to-date .mpx file
  134. +  * for a given .mp file
  135. +  *
  136. +  * John Hobby 3/14/90
  137. +  */
  138. + #ifdef MP
  139. + boolean callmakempx(mpname, mpxname)
  140. + char *mpname, *mpxname;
  141. + {
  142. +         char *cmd, *p, *q, *qlimit;
  143. +         char buf[CMDLENGTH];
  144. +         cmd = getenv("MPXCOMMAND");
  145. +         if (cmd==NULL)
  146. +                 if (troffmode) cmd=TROFFMPX; else cmd=MPXCOMMAND;
  147. +         q = buf;
  148. +         qlimit = buf+CMDLENGTH-1;
  149. +         for (p=cmd; *p!=0; p++)
  150. +                 if (q==qlimit) return 0; else *q++ = *p;
  151. +         *q++ = ' ';
  152. +         for (p=mpname+1; *p!=0 && *p!=' '; p++)
  153. +                 if (q==qlimit) return 0; else *q++ = *p;
  154. +         *q++ = ' ';
  155. +         for (p=mpxname+1; *p!=0 && *p!=' '; p++)
  156. +                 if (q==qlimit) return 0; else *q++ = *p;
  157. +         *q = 0;
  158. +         return system(buf)==0;
  159. + }
  160. + #endif /* MP */